﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace ConexionBD
{
    public partial class Form1 : Form
    {
        MySqlConnection Conexion = new MySqlConnection();
        string cadena;

        
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {

                cadena = "Server=localhost;DataBase=evernote;uid=root;Password=;";
                Conexion.ConnectionString = cadena;
                Conexion.Open();
                MessageBox.Show("Conectado");
                FormMenuPrinc fmp = new FormMenuPrinc();
                fmp.Show();
                Conexion.Close();

            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Error"+Convert.ToString(ex));
            }

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
